<!-- 遍历出所有合作公司 -->
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
    pageContext.setAttribute("path", path);
    pageContext.setAttribute("basePath", basePath);
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core_rt" %>
<html>
<head>
<base href="<%=basePath %>">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>公司管理</title>
    <meta name="description" content="这是一个 index 页面">
    <meta name="keywords" content="index">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="renderer" content="webkit">
    <meta http-equiv="Cache-Control" content="no-siteapp" />
    <link rel="icon" type="image/png" href="assets/i/favicon.png">
    <link rel="apple-touch-icon-precomposed" href="assets/i/app-icon72x72@2x.png">
    <meta name="apple-mobile-web-app-title" content="Amaze UI" />
    <link rel="stylesheet" href="assets/css/amazeui.min.css" />
    <link rel="stylesheet" href="assets/css/admin.css">
    <link rel="stylesheet" href="assets/css/app.css">
    <script>
        function f(k){
            var a=document.getElementById("1");
            if(k==1){
                a.style.display="block";
            }else{
                a.style.display="none";
            }
        }
        
    </script>
    <script type="text/javascript">
    function checkBox(){
        var str = document.getElementsByName("box");
        
        var objarray=str.length;
        var company_ids=""
        for(i=0;i<objarray;i++){
            if(str[i].checked == true){
            	company_ids = str[i].value+"-";
            }
        }
        if(company_ids==""){
            alert("请选择一个公司哦~")
        }else{
        	var con;
        	con=confirm("您确定删除所勾选的几个用户吗?"); //在页面上弹出对话框
        	if(con==true){
        		document.getElementById("company_ids").value=company_ids;
        		document.getElementById( "forms" ).submit();
        	}else{
        		
        	}
        		
        }
        
    }
    
    </script>
</head>
<body data-type="generalComponents">


<header class="am-topbar am-topbar-inverse admin-header">
    <div class="am-topbar-brand">
    </div>
    <div class="am-icon-list tpl-header-nav-hover-ico am-fl am-margin-right">

    </div>

    <button class="am-topbar-btn am-topbar-toggle am-btn am-btn-sm am-btn-success am-show-sm-only" data-am-collapse="{target: '#topbar-collapse'}"><span class="am-sr-only">导航切换</span> <span class="am-icon-bars"></span></button>

    <div class="am-collapse am-topbar-collapse" id="topbar-collapse">

        <ul class="am-nav am-nav-pills am-topbar-nav am-topbar-right admin-header-list tpl-header-list">
            <li class="am-dropdown" data-am-dropdown data-am-dropdown-toggle>
                <a class="am-dropdown-toggle tpl-header-list-link" href="javascript:;">
                    <span class="am-icon-bell-o"></span> 提醒 <span class="am-badge tpl-badge-success am-round">0</span></span>
                </a>
                <ul class="am-dropdown-content tpl-dropdown-content">
                    <li class="tpl-dropdown-content-external">
                        <h3>你有 <span class="tpl-color-success">5</span> 条提醒</h3><a href="###">全部</a></li>
                    <li class="tpl-dropdown-list-bdbc"><a href="#" class="tpl-dropdown-list-fl"><span class="am-icon-btn am-icon-plus tpl-dropdown-ico-btn-size tpl-badge-success"></span> 【预览模块】移动端 查看时 手机、电脑框隐藏。</a>
                        <span class="tpl-dropdown-list-fr">3小时前</span>
                    </li>
                    <li class="tpl-dropdown-list-bdbc"><a href="#" class="tpl-dropdown-list-fl"><span class="am-icon-btn am-icon-check tpl-dropdown-ico-btn-size tpl-badge-danger"></span> 移动端，导航条下边距处理</a>
                        <span class="tpl-dropdown-list-fr">15分钟前</span>
                    </li>
                    <li class="tpl-dropdown-list-bdbc"><a href="#" class="tpl-dropdown-list-fl"><span class="am-icon-btn am-icon-bell-o tpl-dropdown-ico-btn-size tpl-badge-warning"></span> 追加统计代码</a>
                        <span class="tpl-dropdown-list-fr">2天前</span>
                    </li>
                </ul>
            </li>
            <li class="am-dropdown" data-am-dropdown data-am-dropdown-toggle>
                <a class="am-dropdown-toggle tpl-header-list-link" href="javascript:;">
                    <span class="am-icon-calendar"></span> 进度 <span class="am-badge tpl-badge-primary am-round">0</span></span>
                </a>
                <ul class="am-dropdown-content tpl-dropdown-content">
                    <li class="tpl-dropdown-content-external">
                        <h3>你有 <span class="tpl-color-primary">4</span> 个任务进度</h3><a href="###">全部</a></li>
                    <li>
                        <a href="javascript:;" class="tpl-dropdown-content-progress">
                                <span class="task">
                        <span class="desc">Amaze UI 用户中心 v1.2 </span>
                                <span class="percent">45%</span>
                                </span>
                                <span class="progress">
                        <div class="am-progress tpl-progress am-progress-striped"><div class="am-progress-bar am-progress-bar-success" style="width:45%"></div></div>
                    </span>
                        </a>
                    </li>
                    <li>
                        <a href="javascript:;" class="tpl-dropdown-content-progress">
                                <span class="task">
                        <span class="desc">新闻内容页 </span>
                                <span class="percent">30%</span>
                                </span>
                                <span class="progress">
                       <div class="am-progress tpl-progress am-progress-striped"><div class="am-progress-bar am-progress-bar-secondary" style="width:30%"></div></div>
                    </span>
                        </a>
                    </li>
                    <li>
                        <a href="javascript:;" class="tpl-dropdown-content-progress">
                                <span class="task">
                        <span class="desc">管理中心 </span>
                                <span class="percent">60%</span>
                                </span>
                                <span class="progress">
                        <div class="am-progress tpl-progress am-progress-striped"><div class="am-progress-bar am-progress-bar-warning" style="width:60%"></div></div>
                    </span>
                        </a>
                    </li>

                </ul>
            </li>
            <li class="am-hide-sm-only"><a href="javascript:;" id="admin-fullscreen" class="tpl-header-list-link"><span class="am-icon-arrows-alt"></span> <span class="admin-fullText">开启全屏</span></a></li>
        </ul>
    </div>
</header>







    <div class="tpl-page-container tpl-page-header-fixed">


        <div class="tpl-left-nav tpl-left-nav-hover">
            <div class="tpl-left-nav-title">
                功能列表
            </div>
            <div class="tpl-left-nav-list">
                <ul class="tpl-left-nav-menu">
                    <li class="tpl-left-nav-item">
                        <a href="首页.html" class="nav-link tpl-left-nav-link-list">
                            <i class="am-icon-home"></i>
                            <span>首页</span>
                        </a>
                    </li>
                    <li class="tpl-left-nav-item">
                        <a href="订单管理.html" class="nav-link tpl-left-nav-link-list">
                            <i class="am-icon-bar-chart"></i>
                            <span>订单管理</span>
                        </a>
                    </li>

                    <li class="tpl-left-nav-item">
                        <a href="javascript:;" class="nav-link tpl-left-nav-link-list">
                            <i class="am-icon-table"></i>
                            <span>客户管理</span>
                            <i class="am-icon-angle-right tpl-left-nav-more-ico am-fr am-margin-right"></i>
                        </a>
                        <ul class="tpl-left-nav-sub-menu">
                            <li>
                                <a href="公司管理.html">
                                    <i class="am-icon-angle-right"></i>
                                    <span>公司管理</span>
                                </a>

                                <a href="联系人管理.html">
                                    <i class="am-icon-angle-right"></i>
                                    <span>联系人管理</span>
                                </a>
                            </li>
                        </ul>
                    </li>

                    <li class="tpl-left-nav-item">
                        <a href="行程管理.html" class="nav-link tpl-left-nav-link-list">
                            <i class="am-icon-table"></i>
                            <span>行程管理</span>
                        </a>
                    </li>


                    <li class="tpl-left-nav-item">
                        <a href="javascript:;" class="nav-link tpl-left-nav-link-list">
                            <i class="am-icon-wpforms"></i>
                            <span>业绩分析</span>
                            <i class="am-icon-angle-right tpl-left-nav-more-ico am-fr am-margin-right tpl-left-nav-more-ico-rotate"></i>
                        </a>
                        <ul class="tpl-left-nav-sub-menu" style="display: block;">
                            <li>
                                <a href="个人业绩.html">
                                    <i class="am-icon-angle-right"></i>
                                    <span>个人业绩</span>

                                </a>

                                <a href="总体业绩.html">
                                    <i class="am-icon-angle-right"></i>
                                    <span>总体业绩</span>
                                </a>
                            </li>
                        </ul>
                    </li>

                    <li class="tpl-left-nav-item">
                        <a href="修改密码.html" class="nav-link tpl-left-nav-link-list">
                            <i class="am-icon-key"></i>
                            <span>修改密码</span>

                        </a>
                    </li>
                </ul>
            </div>
        </div>





        <div class="tpl-content-wrapper">
            <div class="tpl-portlet-components">
                <div class="portlet-title">
                    <div class="caption font-green bold">
                         公司列表
                    </div>
                    <div class="tpl-portlet-input tpl-fz-ml">
                        <div class="portlet-input input-small input-inline">

                        </div>
                    </div>


                </div>
                <div class="tpl-block">
                    <div class="am-g">
                    <form action="com/del" method="post" id="forms">
                    <input type="hidden" name="company_ids" value="" id="company_ids">
                        <div class="am-u-sm-12 am-u-md-6">
                            <div class="am-btn-toolbar">
                                <div class="am-btn-group am-btn-group-xs">
                                    <button type="button" class="am-btn am-btn-default am-btn-secondary" onclick="location.href='com/toAdd'"><span class="am-icon-plus"></span> 新增</button>
                                    
                                    <button type="button" class="am-btn am-btn-default am-btn-danger" onclick="checkBox()"><span class="am-icon-trash-o"></span> 删除</button>
                                </div>
                            </div>
                        </div>
                                </form>
                        <div class="am-u-sm-12 am-u-md-3">
                            <div class="am-form-group">
                                <select data-am-selected="{btnSize: 'sm'}">
              <option value="option1">所有类别</option>
              <option value="option2">潜在客户</option>
              <option value="option3">偶尔合作</option>
              <option value="option3">长期合作</option>
            </select>
                            </div>
                        </div>
                        <form action="com/list" method="post">
                        <div class="am-u-sm-12 am-u-md-3">
                            <div class="am-input-group am-input-group-sm">
                                <input type="text" class="am-form-field" name="query" id="query" value="${query }">
                                <span class="am-input-group-btn">
            <button class="am-btn  am-btn-default am-btn-success tpl-am-btn-success am-icon-search" type="submit" name="but" id="but"></button>
          </span>
          
                            </div>
                        </div>
                        </form>
                    </div>
                    <div class="am-g">
                        <div class="am-u-sm-12">
                            <form class="am-form">
                                <table class="am-table am-table-striped am-table-hover table-main">
                                    <thead>
                                        <tr>
                                            <th class="table-check"><input type="checkbox" class="tpl-table-fz-check"></th>
                                            <th class="table-id">ID</th>
                                            <th class="table-title">公司名称</th>
                                            <th class="table-type">公司类型</th>
                                            <th class="table-author am-hide-sm-only">合作状态</th>
                                            <th class="table-date am-hide-sm-only">修改日期</th>
                                        </tr>
                                    </thead>
                                    <tbody>
                                    <c:forEach items="${companyList }" var="com">
                                        <tr>
                                            <td><input type="checkbox" name="box" value="${com.company_id }"></td>
                                            <td>${com.company_id }</td>
                                            <td><a href="com/get/${com.company_id }">${com.company_name }</a></td>
                                            <td>${com.company_industry }</td>
                                            <td class="am-hide-sm-only">${com.company_status }</td>
                                            <td class="am-hide-sm-only">${com.company_create_time}</td>
                                        </tr>
                                     </c:forEach>
                                    </tbody>
                                </table>
                                <div class="am-cf">

                                    <div class="am-fr">
                                        <ul class="am-pagination tpl-pagination">
                                            <li><a href="com/list?p=${p-1>=1?p-1:1 }&query=${query }">«</a></li>
                                            <c:if test="${sumPage<='5'}">
                                            <c:forEach var="i" begin="1" end="${sumPage }" > 
                                            <li class="am-active"><a href="com/list?pages=${i }&query=${query } ">${i }</a></li>
                                            </c:forEach>
                                            </c:if>
                                            
                                            <c:if test="${sumPage>'5'}">
                                            <c:forEach var="i" begin="${(p-1)*5+1 }" end="${p*5>sumPage?p+5:sumPage }" > 
                                            <li class="am-active"><a href="com/list?pages=${i }&query=${query } ">${i }</a></li>
                                            </c:forEach>
                                            </c:if>
                                            
                                            
                                            <li><a href="com/list?p=${p+1<pp?p-1:pp }&query=${query }">»</a></li>
                                        </ul>
                                    </div>
                                </div>
                                <hr>

                            </form>
                        </div>

                    </div>
                </div>
                <div class="tpl-alert"></div>
            </div>










        </div>

        <div id="1" class="am-form-group" style=" display:none; z-index: 100; position: absolute; left:50%; top:50%; height: 100px;width: 240px; background-color: #ffffff; border: solid 1px #010407">
            <div class="am-u-sm-9 am-u-sm-push-3" style="margin-top: 30px;padding: 0;">
                <button type="button" class="am-btn am-btn-primary" onclick="f(2)">确认</button>
                <button type="button" class="am-btn am-btn-primary" onclick="f(2)">取消</button>
            </div>
        </div>

    </div>


    <script src="${path }/assets/js/jquery.min.js"></script>
    <script src="${path }/assets/js/amazeui.min.js"></script>
    <script src="${path }/assets/js/app.js"></script>
</body>
</html>